<template>
  <div v-loading="loading">
    <div class="popup_box">
      <!-- 基本信息 -->
      <div class="base">
        <div class="info">
          <div class="title">
            <div class="name">
              {{details.post_title}}
            </div>

            <div class="user">
              <span>(</span>
              <span>考试ID:{{ details.id }}；</span>

              <span>)</span>
            </div>
          </div>
          <div class="details">
            <el-row class="line">
              <el-col :span="12">
                <label class="line_label">报名人数：</label>
                <span class="text">
                  {{ details.enroll_user_count ? details.enroll_user_count : '暂未统计' }}
                </span>
              </el-col>
              <el-col :span="10">
                <label class="line_label">生成准考证时间：</label>
                <span class="text">
                  {{ details.points ? details.points : '暂未生成' }}
                </span>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
      <!-- 切换 -->
      <div class="tab_box">
        <el-tabs v-model="activeName" @tab-click="handleClick($event)">
          <el-tab-pane label="信息下载" name="info">
            <info :examid="info.examid" :kkki_id="info.id"  ref='info'/>
          </el-tab-pane>

          <el-tab-pane label="笔试准考证" name="bishi">
            <bishi :examid="info.examid" :kkki_id="info.id"  ref='bishi'/>
          </el-tab-pane>

          <el-tab-pane label="面试准考证" name="mianshi">
            <mianshi :examid="info.examid" :kkki_id="info.id" ref="mianshi"  />
          </el-tab-pane>
          <el-tab-pane label="体能准考证" name="tineng">
            <tineng :examid="info.examid" :kkki_id="info.id"  ref="tineng"/>
          </el-tab-pane>
          <el-tab-pane label="成绩查询" name="score">
            <score :examid="info.examid" :kkki_id="info.id"  ref="score"/>
          </el-tab-pane>
        </el-tabs>
      </div>

    </div>

  </div>
</template>

<script>

import tineng from '@/views/kaowu/kaowu/examinfo/certcomponents/tineng'
import bishi from '@/views/kaowu/kaowu/examinfo/certcomponents/bishi'
import mianshi from '@/views/kaowu/kaowu/examinfo/certcomponents/mianshi'
import info from '@/views/kaowu/kaowu/examinfo/certcomponents/info'
import score from '@/views/kaowu/kaowu/examinfo/certcomponents/score'


import{examDetail} from '@/api/kaowu/exam'


import { parseTime, setMemberLogin } from '@/utils'

export default {
  name: 'certBasicInfo',
  props: {
    info: {
      default: ''
    }
  },
  filters: {
    timeFilter(timestamp) {
      return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}')
    }
  },
  components: {
    tineng,
    bishi,
    info,
    score,
    mianshi,
  },
  data(){
    return {
      details: [],
      activeName: 'info',
      loading: true,
      dialogBinding: false,
      bind_img: '',
      meetDialogVisible: false,
      callDialogVisible: false,
      showPoster: false,
      posterId: 0,
      posterType: '',
      resumeEnclosure:''
    }
  },
  created () {
    console.log(this.info)

    this.examDetails()
  },
  methods: {
    handleClick(e){
      this.$refs[e.name].init()


    },


    handleClose() {
      this.dialogBinding = false
    },


    examDetails(){
      examDetail({id:this.info.examid}).then((res)=>{
        this.loading= false
        this.details = res.data.info
      })
    },



  }
}
</script>

<style lang="scss" scoped>
  .content{margin-top:20px;}
.complete_percent{
  ::v-deep .el-progress__text{
    color:unset;
  }
}
.bind{
  padding-bottom: 20px;
  text-align: center;
  img{
    width: 256px;
    height: 256px;
  }
  .title{
    margin-top: 20px;
    font-size: 14px;
    color: rgb(156, 156, 156);
  }
}
.bind_icon{
  display: inline-block;
  float: left;
  margin-right: 5px;

}
::v-deep .el-tabs__nav-wrap{
  margin-bottom: 0px;
}
::v-deep .el-tabs__header{
  margin: 0px;
}
::v-deep .el-tabs__nav-scroll{
  line-height: 50px;
  padding-left: 30px;
}
::v-deep .el-tabs__nav-wrap{
  background: #fcfcfc;
  border-top: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
}
::v-deep .el-tabs__nav-wrap::after {
  background-color:transparent
}
//弹窗
.popup_box {
  height: 100%;
  // 基本信息
  .base {
    padding: 20px 30px;
    display: flex;
    .logo {
      width: 118px;
      height: 118px;
      margin-right: 20px;
      background-color: #ebeef5;
      border: 1px solid #ebeef5;
      border-radius: 50%;
      img {
        border-radius: 8px;
        width: 100%;
        height: 100%;
      }
    }
    .info {
      flex: 1;
      .title {
        padding: 5px 0 18px;
        display: flex;
        .name {
          font-size: 20px;
          height: 20px;
          color: #303033;
          font-weight: 600;
          margin-right: 10px;
        }
        .user {
          padding-top: 6px;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
          color: #777;
          .logoin {
            color: #0078ff;
            cursor: pointer;
          }
        }
      }
      .details {
        max-width: 100%;
        .line {
          margin-bottom: 8px;
          .line_label {
            color: #777;
            font-size: 14px;
            line-height: 14px;
            font-weight: normal;
          }
          .text {
            display: inline-block;
            font-size: 14px;
            line-height: 14px;
          }
          .text_color{
            color: #0078ff;
            cursor:pointer ;
          }
        }
      }
    }
    .details{
      .invite_text{
        color: #1787fb;
      }
    }
  }
  .tab_box{
    position: relative;
  }
  .qcc_box{
    width: 63px;
    height: 20px;
    position: absolute;
    right: 30px;
    z-index:30;
    cursor: pointer;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .job_sum{
    color: #f56c6c;
  }
  .close {
    width: 40px;
    height: 60px;
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    .el-icon-close {
      font-size: 30px;
      color: #777;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }
}
// 邀请弹窗
::v-deep .el-dialog__body{
  padding: 1px 0;
}
.code_wrapper{
  text-align: center;
  .code_img{
    width: 256px;
    height: 256px;
  }
  .code_text{
    font-size: 12px;
    color: #979797;
  }
  .tip{
    font-size: 14px;
    font-weight: 300;
    color: #f56c6c;
    background-color: #fef0f0;
    margin: 20px auto;
    padding: 10px 20px;
    text-align: center;
  }
}
</style>
